<template>
  <a-modal
    title="头像预览"
    ok-text="确认"
    cancel-text="取消"
    :visible="visible"
    :destroyOnClose="true"
    :footer="null"
    @cancel="handleCancel"
  >
    <img alt="example" style="width: 100%" :src="previewImage" />
  </a-modal>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      previewImage: "",
    };
  },
  methods: {
    showModal(previewImage) {
      this.visible = true;
      this.previewImage = previewImage;
    },
    handleCancel() {
      this.visible = false;
    },
  },
};
</script>
